<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
namespace think;

require __DIR__ . '/../vendor/autoload.php';

/**
 * 定义是否在开发服务器上
 */
//defined('ONDEV') || define('ONDEV', stripos($_SERVER['HTTP_HOST'], 'staging'));
//defined('ONDEV', true);
 define('ONDEV', true);
/**
 * 定义网站http协议
 */
define('HTTP_PROTOCOL', ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://');

/**
 * 定义网站url
 */
define('SITE_URL', HTTP_PROTOCOL.$_SERVER['HTTP_HOST']);

define('ROOT_PATH',  dirname( dirname(__FILE__) ));

define('MODULE_PATH', ROOT_PATH.'/app');
define('UPLOAD_DIR', ROOT_PATH.'/public');
/**
 * 定义上传文件夹，没有目录分隔符
 */
define('UPLOAD_FOLDER', 'storage');
/**
 * 定义上传临时文件夹，没有目录分隔符
 */
define('UPLOAD_TMP_FOLDER', 'static/upload/uploadtmp');

/**
 * 定义上传文件夹url
 */
define('UPLOAD_URL', SITE_URL.'/'.UPLOAD_FOLDER);

/**
 * 定义文件上传路径
 */
define('UPLOAD_PATH',UPLOAD_DIR.'/'.UPLOAD_FOLDER.'/');

define('MERGE_BG',      '#ffffff');                         // 缩略图补偿背景色

// 执行HTTP应用并响应
$http = (new App())->http;

$response = $http->run();

$response->send();

$http->end($response);
